CNN Host Installation on Linux
In a Hybrid deployment you use the power of our Cloud conversational engine but you use one DRUID-specific component which will store all the conversational data in your infrastructure. In Hybrid deployments, the Druid bots running in the Druid Cloud are integrated with on premise apps. The bots and on premise apps communicate via the Druid Connector Host installed on your local servers, usually hosted in your DMZ zone.
This section describes the CNN Host installation procedure using Linux docker containers.
General Prerequisites
- Make a request to Druid Tech Support to activate the Hybrid-mode for your tenant.
- Provide your tenant code. The tenant code is mentioned as parameter
{{YOUR-TENANT-NAME}}
throughout this section. - After the tenant has been activated for Hybrid-mode, you will receive from Druid team the values for some variables to be used during installation:
- You have an admin account to access your Druid Online tenant.
- Create dedicated user in Druid Portal, with "Druid Backend API" permissions (the parameter is
{{WEB-API-USER-NAME}}
).
Variable | Description |
---|---|
{{Druid-CONNECTOR-VERSION}}
|
The Technical code of the CNN version. |
{{Druid-LOGIN-ID}}
|
User Id to connect to Druid repository. |
{{Druid-LOGIN-PASSWORD}}
|
The Password for {{Druid-LOGIN-ID}} . |
Infrastructure Prerequisites
DB Server
You can use a dedicated server or a shared instance.
Hardware requirements
Item |
Testing Environment |
Production Environment |
---|---|---|
CPU count |
1 |
2 |
CPU Type |
Proc Intel i7 gen 8 min or equivalent Xeon.
|
|
RAM |
4 Gib |
8 Gib |
Storage Type |
Min 500 IOPS
|
|
Storage Size |
OS: 120 GiB |
OS: 120 GiB |
|
Data: 10 GiB |
Data: 100 GiB |
Software requirements
- OS: Windows 2016 (or newer) – updates “up to date”.
- SQL Server Express Edition 2016 or later (up to 10GiB) or Standard Edition 2016 or later:
- Collation: Latin1_General_CI_AS
- Windows and SQL Server Authentication mode enabled.
- TCP Protocol enabled (in SQL Server Configuration Manager). SQL Server port is open in the firewall of the DB Server. The port must be fix port and not dynamically allocated.
- SQL Server Management Studio (SSMS). Alternatively, you can use Azure Data Studio or osql utility to run T-SQL statements necessary in installation process.
Connector Host Server (CNN)
CNN Hardware requirements
Item |
Testing Environment |
Production Environment |
---|---|---|
CPU count |
2 |
4 |
CPU Type |
Proc Intel i7 gen 8 min or equivalent Xeon.
|
|
RAM |
8 GiB |
16 GiB |
Storage Type |
Min 500 IOPS.
|
File system layout
Directory |
Description |
Testing Environment |
Production Environment |
---|---|---|---|
/ |
Root, boot |
30 GiB |
50 GiB |
/opt/Druid |
Druid Platform application directory |
10 GiB |
100 GiB |
/var/lib/docker |
Docker service directory |
30 GiB |
50 GiB |
/tmp |
Temporary directory |
20 GiB |
20 GiB |
CNN Software requirements
- OS: Linux
- min kernel 3.10 under one of the following distributions:
- Debian 10
- Ubuntu 18.04 LTS
- RedHat 7.x
- CentOS 7
- latest updates are installed Additional software
- Docker
- Docker compose
Network Matrix
Source Name | IP | URL | Destination Name | IP | URL | Protocol | Port | Function | Used at |
---|---|---|---|---|---|---|---|---|---|
CNN machine name | TBD | N/A | DB Server name | TBD | N/A | TCP | 1433 | Conversation History - MS SQL Server InStance | Utilization |
N/A |
52.236.186.66 13.69.106.64 13.69.64.64 |
prod2-Druidbus.servicebus.windows.net | AMQPS | 5671 | Druid Service BUS (used for messages exchange) | Utilization | |||
N/A | N/A | {{YOUR-TENANT-NAME}}. Druidplatform.com | HTTPS | 443 | Druid Platform stored in Azure EU | Utilization | |||
N/A | N/A | prodDruidbot.blob.core.windows.net | HTTPS | 443 | Druid Platform Blob storage (required for in-transit user uploads, with archived data size bigger than 250KB) | Utilization | |||
TBD | TBD | TBD | TBD | TBD | Used to connect to any other enterprise services (e.g. UIPath orchestrator) – to be defined based on the needs | Utilization | |||
N/A | N/A | Druidcontainerregistry.azurecr.io | HTTPS | 443 | Druid containers' repositories | Installation | |||
N/A | N/A |
https://dseasb33srnrn.cloudfront.net https://elb-io.us-east-1.aws.dckr.io https://elb-registry.us-east- 1.aws.dckr.io https://index.docker.io |
HTTPS | 443 | Docker container registry | Installation | |||
Once you meet all the prerequisites, you can install Druid Connector Host on Linux.
Install the DB Server (one-time activities)
- In your SQL Server instance, create CNN database with collation SQL_Latin1_General_CP1_CI_AS: Druid Platform Connector-Host database
{{CONNECTOR-DB-NAME}}
. - You can create the database by using the SSMS interface, or by using the following query:
- In your SQL Server instance, create the login who will have the dbOwner role against the CNN database. This user must have SQL Server authentication type and assigned to public role (that is, the default one). Make sure the check boxes Enforce password policy and Enforce password expiration are not checked. You can create the login by either using the SSMS interface, or the following query:
- Set the database owner to newly created Login for each Druid Platform databases:
- Check SQL Server connection:
- By using any SQL Server client (e.g., SSMS, osql, etc.) try connection to the recently configured databases and use
{{DB-OWNER-USER}}
as credential. - Be sure that your SQL Server instance is accessible from the CNN machine via its configured port (e.g., 1433).
use master
go
create database [{{CONNECTOR-DB-NAME}}]
go
{{CONNECTOR-DB-NAME}}
with the name you have chosen before running the query.
use master
go
create login [{{DB-OWNER-USER}}] with password=N'{{DB-OWNER-USER-PASSWORD}}', default_database=[master], check_expiration=OFF, check_policy=OFF
go
{{DB-OWNER-USER}}
with the username and {{DB-OWNER-USER-PASSWORD}}
with the password.
use [{{CONNECTOR-DB-NAME}}]
go
exec sp_changedbowner '{{DB-OWNER-USER}}'
go
Install the Connector Host Server (one-time activities)
This section covers all the necessary steps to install CNN Host on a Linux machine (hosting Druid Connector containers). To easily operate, you need to perform all steps in elevated mode; therefore, before starting the installation, run the following command:
sudo -s
- Ensure latest updates are installed.
- Install Docker.
- Configure Docker to start on boot.
- Confirm the right execution of the docker:
- Remove the hello-world container and image:
- Install docker-compose.
- Run the following command to download the current stable release of Docker Compose:
- Apply executable permissions to the binary:
- Test the installation of docker-compose.
Linux Distribution | Installation Steps |
---|---|
Debian | https://docs.docker.com/engine/install/debian/ |
Ubuntu | https://docs.docker.com/engine/install/ubuntu/ |
Red Hat Enterprise Linux | https://docs.docker.com/engine/install/rhel/ |
CentOS | https://docs.docker.com/engine/install/centos/ |
systemctl enable docker
docker run hello-world
docker rm $(docker ps -aq -f "ancestor=hello-world") --force
docker image rm $(docker images hello-world -q)
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
Install the Connector Host Server
- Click the button below to download the installation package, Druid-cnn.tar.gz.
- Upload it on the Linux machine to the /tmp directory.
- Extract the content of the archive:
- Rename the file /tmp/Druid-cnn/Druid.opt/dc.files/dev.env to /tmp/Druid-cnn/Druid.opt/dc.files/prod.env.
- Rename the directory /tmp/Druid-cnn/Druid.opt/dev to /tmp/Druid-cnn/Druid.opt/prod.
- Edit the file /tmp/Druid-cnn/Druid.opt/dc.files/prod.env and change the line
COMPOSE_PROJECT_NAME=dev
toCOMPOSE_PROJECT_NAME=prod
. - Create the application directory.
- Copy the directory structure.
- Parametrize the application. Edit the file /opt/Druid/dc.files/dev.env and update the values of the variables described in the table below (replace them with their actual values):
- Manage the Druid CNN Host certificate.
- In a browser, access the Druid Portal (https://{{YOUR-TENANT-NAME}}.Druidplatform.com) and, on the Administration menu, click Connector Certificate. Click Actions > Download.
- Rename the downloaded file to <guid>.pfx. For example, from the current name test-20220321-20320321(0d9f61d7-bdf5-409c-853cce9d133747d5).pfx rename to 0d9f61d7-bdf5-409c-853c-ce9d133747d5.pfx
- Upload the file to Linux machine to the directory: /opt/Druid/dev/cert/cert.
- Make sure that the uploaded file has Read right:
- Authenticate to Druid's container repository.
- Execute the following command after replacing the variables with their values:
- Type the password
{{Druid-LOGIN-PASSWORD}}
- Start Druid CNN Host.
- Check the status.
mkdir -p /tmp/Druid-cnn cd /tmp
tar -xzvf Druid-cnn.tar.gz -C /tmp/Druid-cnn
Ignore the following warning message if it appears "tar: A lone zero block at 1230168".
For PROD installations:
mkdir -p /opt/Druid
chown -R root:root /opt/Druid
cp -r /tmp/Druid-cnn/Druid.opt/* /opt/Druid
Variable | Description |
---|---|
{{Druid-CONNECTOR-VERSION}}
|
The Technical code of the CNN version |
{{YOUR-TENANT-NAME}}
|
Your tenant code assigned by the Druid team |
{{WEB-API-USER-NAME}}
|
Technical user used for programmatic access to the Druid Platform API. |
{{WEB-API-USER-PASSWORD}}
|
The password of {{WEB-API-USER-NAME}} . |
{{SQL-SERVER-NAME}}
|
The SQL Server instance to store the CNN's conversation-history database, e.g. SQLDEV,1433. |
{{CONNECTOR-DB-NAME}}
|
CNN’s conversation history database. |
{{DB-OWNER-USER}}
|
The dbowner of the Druid SQL databases. |
{{DB-OWNER-USER-PASSWORD}}
|
The password of {{DB-OWNER-USER}} . |
The downloaded file name pattern is {{YOUR-TENANT-NAME}}-[start-validity-date]-[end-validity-date](guid).pfx
.
chmod +r /opt/Druid/dev/cert/cert/{{GUID}}.pfx
docker login Druidcontainerregistry.azurecr.io -u {{Druid-LOGIN-ID}}
watch docker ps -a
The response would be similar to:
Every 2.0s: docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b5e5ff091ca0 Druidcontainerregistry.azurecr.io/Druidconnector:1.61.0-beta.1-2 "./App_Data/start-cn…" 20 seconds ago Up 19 seconds (health: starting) 12345/tcp Druidconnector-dev